package net.oschina.arvin.dbjava.model;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

/**
 * 属性描述
 *
 * @author Arvin
 * @time 2017/9/29 17:31
 */
public class FieldDescriptor {

    /** 属性本身 */
    private Field field;

    /** 注释 */
    private String comment;

    /** 是否主键 */
    private boolean primaryKey;

    /** 是否唯一 */
    private boolean unique;

    /** 是否有对应的getter */
    private Method getter;

    /** 是否有对应的setter */
    private Method setter;

    public Field getField() {
        return field;
    }

    public void setField(Field field) {
        this.field = field;
    }

    public String getName() {
        return field.getName();
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public boolean isPrimaryKey() {
        return primaryKey;
    }

    public void setPrimaryKey(boolean primaryKey) {
        this.primaryKey = primaryKey;
    }

    public boolean isUnique() {
        return unique;
    }

    public void setUnique(boolean unique) {
        this.unique = unique;
    }

    public Method getGetter() {
        return getter;
    }

    public void setGetter(Method getter) {
        this.getter = getter;
    }

    public Method getSetter() {
        return setter;
    }

    public void setSetter(Method setter) {
        this.setter = setter;
    }
}
